package com.xiaowu.xblog.service;// ==================== 通用Service接口 ====================
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;

public interface BaseService<T> {

    boolean create(T entity);

    boolean createBatch(Collection<T> entityList);

    boolean createOrUpdate(T entity);

    boolean createOrUpdateBatch(Collection<T> entityList);

    boolean deleteById(Serializable id);

    boolean deleteByIds(Collection<? extends Serializable> idList);

    boolean delete(Wrapper<T> queryWrapper);

    boolean updateById(T entity);

    boolean updateBatchById(Collection<T> entityList);

    boolean update(T entity, Wrapper<T> updateWrapper);

    T findById(Serializable id);

    List<T> findByIds(Collection<? extends Serializable> idList);

    List<T> findAll();

    List<T> findList(Wrapper<T> queryWrapper);

    IPage<T> findPage(IPage<T> page);

    IPage<T> findPage(IPage<T> page, Wrapper<T> queryWrapper);

    long count();

    long count(Wrapper<T> queryWrapper);

    boolean exists(Wrapper<T> queryWrapper);
}
